import rospy
import tf
import time
import sys
import math
import serial
import string
import ctypes
import random


device_port = '/dev/move_base'
baudrate = 115200

cmd = [0x5A, 0x0E, 0x01, 0x01, 0x00, 0x05, 0x00, 0x84, 0x00, 0x05, 0x00, 0x32, 0x00, 0xFF]
try:
    serial = serial.Serial(device_port,baudrate,timeout=10)
    rospy.loginfo("Opening Serial")
    try:
        if serial.in_waiting:
            serial.readall()
    except:
        rospy.loginfo("Opening Serial Try Faild")
        pass
except:
    rospy.logerr("Can not open Serial"+device_port)
    serial.close
    sys.exit(0)
try:
    while True:
        serial.write(cmd)
except:
    rospy.logerr("Vel Command Send Faild")
